    $(document).ready(function(){   
        setStyle("search");
        
        $("#a_head_l").hide();
        $("#a_head_r").hide();
        
    });  
    
    function butPress(){
       var choice = $("#type :radio:checked").attr('id');
       var input  = $('#message').val();
       
       console.log(choice+" "+input);
       var count = 10;
       $.mobile.loading('show');
       var http = "http://anibox.me//api.php?task=search&type="+choice+"&count="+count+"&query="+input;
       $.getJSON(http, parseJson);
    }
    
    function parseJson(data){
    	var count = data.count;
    	for(var i in data.posts){
    		$('#list').append(
                '<li id="' + data.posts[i].id + '" onClick="liOnClick(this.id);">' +
                
                '<div class="div_style_update" style="font-weight:bold;">'+
                 data.posts[i].title +
                 '</div>'+
                '</li>\n'
            );
        }
        $('#list').listview('refresh');
        $.mobile.loading('hide');
    	
    }
    
    function liOnClick(id){
    	var choice = $("#type :radio:checked").attr('id');
    	goToPage("../records/type.html?task=get_"+choice+"&id="+id);
    }